﻿using StandXunYouServer.Dto;
using StandXunYouServer.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StandXunYouServer.IServices
{
    public interface ILotteryServices
    {
        /// <summary>
        /// 获取所有奖品
        /// </summary>
        /// <returns></returns>
        public Task<IEnumerable<Prizes>> GetPrizesQueryAsync();

        /// <summary>
        /// 获取数量不为零的所有奖品
        /// </summary>
        /// <returns></returns>
        public Task<IEnumerable<Prizes>> GetPrizesIsZeroQueryAsync();

        /// <summary>
        /// 获取用户锁拥有的奖品
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public Task<IEnumerable<UserPrizeDto>> GetByUserIdQueryAsync(string userId);

        /// <summary>
        /// 判断用户积分是否足够
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public Task<int> IsUserPointsAsync(string userId);

        /// <summary>
        /// 修改用户积分、扣除奖品数量、为用户添加奖品
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="model"></param>
        /// <returns></returns>
        public Task<bool> UpdatePointsPrizeCountAndInsertUserPrizeAsync(string userId, UserPrize model);
    }
}
